﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Traceability.Infrastructure.Migrations
{
    public partial class log6 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "MyProperty",
                table: "企业信息",
                newName: "CompanyType");

            migrationBuilder.AddColumn<string>(
                name: "DetailAddress",
                table: "企业信息",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.CreateTable(
                name: "屠宰信息",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    AverageWeight = table.Column<int>(type: "int", nullable: false),
                    ArrivalTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    SlaughterTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_屠宰信息", x => x.ID);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "屠宰信息");

            migrationBuilder.DropColumn(
                name: "DetailAddress",
                table: "企业信息");

            migrationBuilder.RenameColumn(
                name: "CompanyType",
                table: "企业信息",
                newName: "MyProperty");
        }
    }
}
